﻿@{
    ViewBag.Title = "VR楼宇入住日志";
}
@section headerSection{
    <style>
        #exampleToolbar > .form-group {
            float: left;
            margin: 0;
            margin-left: 5px;
        }
    </style>
}
<div class="animated fadeInRight">
    <!-- Panel Other -->
    <div class="ibox float-e-margins" style="margin-bottom: 0px;">
        <div class="ibox-content" style="padding: 5px 20px 0px 20px;">
            <div class="row row-lg">
                <div class="col-sm-12 col-sm-leftRight">
                    <!-- Example Toolbar -->
                    <div class="example">
                        <table id="exampleTableToolbar" data-mobile-responsive="true" data-radio="true"></table>
                    </div>
                    <!-- End Example Toolbar -->
                </div>
            </div>
        </div>
    </div>
    <!-- End Panel Other -->
</div>
@section footSection{
    <script>
        var $table, options, file_id;
        var experRecordManager = {
            //1.0 初始化页面
            initPage: function () {
                parent.showLoadBoxs();
                experRecordManager.initData();
                experRecordManager.initTable();
                parent.delLoadBoxs();
            },
            initData: function () {
                file_id = $.getUrls("file_id");
                if (!file_id) {
                    layer.alert("页面参数传递错误！");
                    return false;
                }
            },
            //1.1 初始化Table
            initTable: function () {
                options = {
                    url: ctx + "/VRBuilding/InitBuildLogTable",
                    cutHeight: 5,
                    showRefresh: false,
                    showToggle: false,
                    showColumns: false,
                    queryParams: function (params) {
                        params = {
                            rows: params.limit,
                            //页面大小
                            page: params.offset / params.limit + 1,
                            file_id:file_id
                        }
                        return params;
                    },
                    columns: [
                        {
                            radio: true
                        }, {
                            field: '',//第一列序号
                            title: '序号',
                            align: 'center',
                            width: 50,
                            formatter: function (value, row, index) {
                                return index + 1;
                            }
                        },
                        {
                            field: 'user_img',
                            title: '头像',
                            align: 'center',
                            formatter: function (value, row, index) {
                                if (value)
                                    return "<img src='" + value.toString().replace("~", window.location.origin + ctx) + "' style='width:80px;height:80px;' />";
                                return "";
                            }
                        },
                        {
                            field: 'user_name',
                            title: '用户名',
                            align: 'center'
                        },
                        {
                            field: 'user_phone',
                            title: '手机号',
                            align: 'center'
                        },
                        {
                            field: 'in_date',
                            title: '入住时间',
                            align: 'center'
                        }, {
                            field: 'out_date',
                            title: '搬出时间',
                            align: 'center'
                        }],
                    onClickRow: function (row, $element) {
                    }
                }
                $table = tableHelper.initTable("exampleTableToolbar", options);
            }
        }
        $(function () {
            experRecordManager.initPage();
        });
    </script>
}